package edu.uwosh.cs342.group5;

import org.json.JSONException;
import org.json.JSONObject;

import android.os.AsyncTask;

public class AsyncPlaces extends AsyncTask<Void, Void, JSONObject>{
	String key;
	double lat;
	double longs;
	boolean sensor;
	int radius;

	AsyncPlaces(String key, double lat, double longs, boolean sensor, int radius){
		this.key = key;
		this.lat = lat;
		this.longs = longs;
		this.sensor = sensor;
		this.radius = radius;
	}
	
	@Override
	protected JSONObject doInBackground(Void... params) {
		try {
			return new JSONObject(PlaceSearch.nearbyPlaces(key, lat, longs, sensor, radius));
		} catch (JSONException e) {
			e.printStackTrace();
			return null;
		}
	}
	
	@Override
	protected void onPostExecute(JSONObject results){
	}

}
